package com.foreveross.fetl.core.domain.doub;

import java.sql.SQLException;
import java.util.Collection;
import java.util.List;

import com.dayatang.domain.InstanceFactory;
import com.foreveross.fetl.common.vo.model.doub.DoublePlaneInfo;
import com.foreveross.fetl.core.domain.doub.repository.IDoublePlaneInfoRepository;


/**
 * 来回程（往返程）航班信息模型
 * 
 * @author Administrator
 * 
 */
public class DoublePlaneInfoEntity  extends DoublePlaneInfo {
	
	private Long id;
	
	private Long doublePlaneInfoJson;	

	private DoublePlanInfoJsonEntity doublePlanInfoJsonEntity;

	

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getDoublePlaneInfoJson() {
		return doublePlaneInfoJson;
	}

	public void setDoublePlaneInfoJson(Long doublePlaneInfoJson) {
		this.doublePlaneInfoJson = doublePlaneInfoJson;
	}


	public DoublePlanInfoJsonEntity getDoublePlanInfoJsonEntity() {
		return doublePlanInfoJsonEntity;
	}

	public void setDoublePlanInfoJsonEntity(
			DoublePlanInfoJsonEntity doublePlanInfoJsonEntity) {
		this.doublePlanInfoJsonEntity = doublePlanInfoJsonEntity;
	}

	public IDoublePlaneInfoRepository getIDoublePlaneInfoRepository(){
		return InstanceFactory.getInstance(IDoublePlaneInfoRepository.class);
	}
	
	
	/**
	 * 保存
	 * @param entity
	 * @throws SQLException
	 */
	public void create(DoublePlaneInfoEntity entity) throws SQLException{
		getIDoublePlaneInfoRepository().create(entity);
	}
	
	public void create(Collection<DoublePlaneInfoEntity> collections)
			throws SQLException {
		getIDoublePlaneInfoRepository().create(collections);
	}
	
	/**
	 * 删除
	 * @param entity
	 * @throws SQLException
	 */
	public void delete(DoublePlaneInfoEntity entity) throws SQLException{
		getIDoublePlaneInfoRepository().delete(entity);
	}
	
	public void delete(Collection<DoublePlaneInfoEntity> collections)
			throws SQLException {
		getIDoublePlaneInfoRepository().delete(collections);
	}
	
	/**
	 * 查planeInfo的信息
	 * @param hbaseKey
	 * @param fromCity
	 * @param toCity
	 * @param flightBatchDate
	 * @param returnFlightDate
	 * @param flightNo
	 * @return
	 * @throws SQLException
	 */
	public List<DoublePlaneInfoEntity> findByCondition(String hbaseKey,
			String fromCity, String toCity, String flightBatchDate,
			String returnFlightDate, String flightNo) throws SQLException {
		return getIDoublePlaneInfoRepository().findByCondition(hbaseKey,
				fromCity, toCity, flightBatchDate, returnFlightDate, flightNo);
	}
	/**
	 * 查询 planInfo  只返回 planeInfo 的主属性 
	 * @param hbaseKey
	 * @param fromCity
	 * @param toCity
	 * @param flightBatchDate
	 * @param returnFlightDate
	 * @param flightNo
	 * @return
	 */
	public List<DoublePlaneInfoEntity> findPlaneInfoProperty(String hbaseKey,
			String fromCity, String toCity, String flightBatchDate,String returnFlightDate,String flightNo){
		return getIDoublePlaneInfoRepository().findPlaneInfoProperty(hbaseKey,
				fromCity, toCity, flightBatchDate, returnFlightDate, flightNo);
	}
	
	/**
	 * 返回全部属性
	 * @param hbaseKey
	 * @param fromCity
	 * @param toCity
	 * @param flightBatchDate
	 * @param returnFlightDate
	 * @param flightNo
	 * @return
	 */
	public List<DoublePlaneInfoEntity> findPlanInfoAndFamily(String hbaseKey,
			String fromCity, String toCity, String flightBatchDate,String returnFlightDate,String flightNo){
		return getIDoublePlaneInfoRepository().findPlanInfoAndFamily(hbaseKey,
				fromCity, toCity, flightBatchDate, returnFlightDate, flightNo);
	}
	
	
}
